home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-25 | 6.8 KB | 173 lines | [TEXT/MPS ] |
- // File: Context.h
- // Copyright: © 1993 Apple Computer, Inc. All rights reserved.
- // Author: Victor J. Hnyp
- // Dave Lyons
- // Date: 3-Mar-94
-
- // Revisions
- //
- // 03/03/94 DAL 3.02 Moved from Dialog Context to Window Context: isFindDialog,
- // isFindMoreDialog, isAnyDialogActive. The selector numbers
- // had to change.
- //
- // 01/13/94 DAL 3.01 Added allBitsSet and someBitsSet compare selectors for Gestalt
- // check. (They aren't really needed in this file, but it was the
- // closest thing I found to a master list.)
- //
- // -----------------------------------------------------------------------------------------------
- //
- // 11/5/93 JJ 2.12 Added isCollapsed to Window module
- //
- // 9/3/93 JJ 2.11 Added isAnyZones to Chooser module
- //
- // 04/08/93 VJH 2.10 Moved isFindDialog, isFindMoreDialog back to Dialog module.
- //
- // 03/13/93 VJH 2.09 Moved isFindDialog, isFindMoreDialog to Window module.
- //
- // 03/11/93 VJH 2.08 Added selectors: seeFolders, seeFiles, makeChanges.
- //
- // 02/24/93 VJH 2.07 Added isShareWindowOpen, isShareWindowActive. Removed isSharedOwned.
- //
- // 01/18/93 VJH 2.06 Minor fixups
- //
- // 01/18/93 VJH 2.05 Added isFileExists
- //
- // 01/04/93 VJH 2.04 Changed Copyright notice, minor cleanup
- //
- // 12/14/92 VJH 2.03 Added Chooser and System constants, eliminated some duplicates
- //
- // 11/29/92 VJH 2.02 Added File constants
- //
- // 11/16/92 GB 2.01 Added "kCntx" constants
- //
-
- // All structures consists of 5 longs and 2 StringSpecs.
- // Total length is 20 bytes + strings.
- // Format:
- // longint; // REQUIRED (but not passed to module)
- // // 4-character module ID - One of:
- // 'CHSR' - Chooser Module
- // 'DLOG' - Dialog Module
- // 'FILE' - File Module
- // 'FNDR' - Finder Module
- // 'PCSS' - Process Module
- // 'SYST' - System Module
- // 'WIND' - Window Module
- // longint; // REQUIRED (by each module)
- // Function Selector within the module
- // longint; // anything
- // longint; // StringCompareMethod of StringSpec
- // pstring; // String of StringSpec (variable len.)
- // align word;
- // longint; // StringCompareMethod of StringSpec
- // pstring; // String of StringSpec (variable len.)
- // The pstring can be any variable-length structure.
- // We go to this trouble for two reasons:
- // 1. To be able to write a ResEdit TMPL for localization.
- // 2. To encapsulate a "universal" context test spec.
-
-
- #define kCntxSystem 'SYST'
- #define kCntxWindow 'WIND'
- #define kCntxProcess 'PCSS'
- #define kCntxDialog 'DLOG'
- #define kCntxChooser 'CHSR'
- #define kCntxFile 'FILE'
- #define kCntxFinder 'FNDR'
-
-
- // This defines the General Compare Selectors:
-
- #define off 0
- #define on 1
- #define equals 2
- #define notEqualTo 3
- #define greaterThan 4
- #define lessThan 5
- #define greaterThanOrEqualTo 6
- #define lessThanOrEqualTo 7
- #define containsAnything 8
- #define empty 9
- #define matches 10
- #define contains 11
- #define startsWith 12
- #define endsWith 13
- #define seeFolders 14
- #define seeFiles 15
- #define makeChanges 16
-
- #define allBitsSet 17 /* Gestalt: all specified bits are set */
- #define someBitsSet 18 /* Gestalt: some specified bits are set */
-
- #define ModemPort 0 /* We are interested in the modem port */
- #define PrinterPort 1 /* We are interested in the printer port */
- #define EitherPort 2 /* We are interested in either port */
-
-
- // This defines the Dialog, Window, and Process Context function selectors:
-
- #define isFront 0 // Interested in the front dialog/window/application...
- #define isOpen 1 // Interested in the open dialog/window/application...
- #define isInvisible 2 // Is the name of the invisible dialog/window...
- #define isCollapsed 5 // Is the window collapsed by WindowShade
-
-
- // This defines the Chooser Selectors:
-
- #define isPrinterDirect 0 // Is a printer connected directly to this Macintosh?
- #define isPrintersOnZone 1 // Is the number of network printers connected to our zone...?
- #define isPrinterSerial 2 // Is a serial printer connected to this Macintosh through ModemPort/PrinterPort?
- #define isPrinterSCSI 3 // Is a printer connected to this Macintosh through a SCSI port?
- #define isPrinterType 4 // Is the selected printer named...
- #define isAppleTalk 5 // Is AppleTalk on/off?
- #define isNumberOfZones 6 // Does the network have any zones?
- #define isPortSelected 7 // Is ModemPort/PrinterPort selected?
- #define isPortInUse 8 // Is ModemPort/PrinterPort currently in use?
- #define isAnyZones 9 // 2 or 3 boxes in the Chooser?
-
- // This defines additional Dialog Context Selectors:
-
- // (none, since isFindDialog, isFindMoreDialog, and isAnyDialogActive moved to Window)
-
-
- // This defines the File Selectors:
-
- #define isFrontStartup 0 // Is the frontmost (active) window the same name as the startup volume name?
- #define isOpenStartup 1 // Is the name of any open and visible window the same name as the startup volume name?
- #define isCDStartup 2 // Is the current directory the startup disks?
- #define isPrintMonitor 3 // Is PrintMonitor installed?
- #define isAppleShare 4 // Is AppleShare support software installed?
- #define isEtherTalk 5 // Is EtherTalk support software installed?
- #define isTokenTalk 6 // Is TokenTalk support software installed?
- #define isControlPanel 7 // Is the Control Panel named "..." installed?
- #define isFileExists 9 // Is the File named "..." within the system-defined folder ...?
-
-
- // This defines the System Selectors:
-
- #define gestaltCheck 0 // How does Gestalt selector "..." compare to result "..."?
- #define menuItemExists 1 // Does menuItem titled "..." exist within menu titled "..."?
- #define menuItemMarked 2 // Is the menu item titled "..." marked within menu titled "..."?
- #define menuItemEnabled 3 // Is the menu item titled "..." enabled within menu titled "..."?
- #define menuItemDisabled 4 // Is the menu item titled "..." disabled within menu titled "..."?
- #define isBackgroundPrinting 5 // Is background printing on/off?
- #define isFileSharing 6 // Is file sharing on/off?
- #define isVideoHWBitDepth 7 // Is the video hardware bit depth...?
- #define isMonitorBitDepth 8 // Is the main video monitor color depth...?
- #define isComputerNamed 9 // Does the computer have a name?
- #define isGuestAccess 10 // Is guest access for files available?
- #define isNumberMonitors 11 // Is the number of monitors...?
-
-
- // This defines additional Window Context Selectors:
-
- #define isShareWindowOpen 3 // Is the "Sharing" window open?
- #define isShareWindowActive 4 // Is the "Sharing" window the active window?
-
- // isCollapsed is 5
-
- #define isFindDialog 6 // Is the Find Dialog active?
- #define isFindMoreDialog 7 // Is the Find "More Choices" Dialog active?
- #define isAnyDialogActive 8 // Is any Dialog currently active?
-
-